The description of harmonised variables is the following:
cont_relAre the contacts ( face-to-face/phone/mail/Internet communicators) with family members/relatives frequent (i.e. contact once a week or more often)?Social environmentcathegorical| Code | Category Label |
|---|---|
| 0 | No |
| 1 | Yes |
| Code | Category Label |
|---|---|
| 991 | CAPI/interviewer error |
| 992 | Impute |
| 993 | Disable to measure |
| 994 | Not attempt/not done |
| 995 | Does not answer |
| 996 | Not applicable |
| 997 | Refuse |
| 998 | Do not know |
| 999 | Missing |
The study-specific variables elected to be harmonised are:
scchdgOn average how often do you meet up with your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-1 = Item not applicablescfamgOn average how often meet up with family members1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-1 = Item not applicablescchdhon average how often do you speak on the phone to your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-1 = Item not applicablescchdion average how often do you write or email your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-1 = Item not applicablescfamion average how often do you write or email family members1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-1 = Item not applicabledhr2 UP TO dhr13What is [your/member of household~s] relationship to [person 2]1 = Husband/Wife2 = Partner/cohabitee3 = Natural son/daughter4 = Adopted son/daughter5 = Foster son/daughter6 = Step son/daughter/child of partner7 = Son/daughter-in-law8 = Natural parent9 = Adoptive parent10 = Foster parent11 = Stepparent/parent s partner12 = Parent-in-law13 = Natural brother/sister14 = Half-brother/sister15 = Step-brother/sister16 = Adopted brother/sister17 = Foster brother/sister18 = Brother/sister-in-law19 = Grandchild20 = Grandparent21 = Other relative22 = Other non-relative96 = Self (THIS CODE NOT USED)-9 = Refusal-8 = Don't Know-1 = Not applicableNote: IF relationship os self: DHR=96, “Code 96 is not valid for this question”
Description:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To compute the harmonize variable from the study-specific variable it has to be recoded as follows:
scchdg OR scfamg in {1,2,3} OR scchdh OR scchdi OR scfami in {1,2} OR any of dhr2,..,dhr13 in 1:21 into 1scchdg AND scfamg in {4,5,6} AND scchdh AND scchdi AND scfami in {3,4,5,6} AND all dhr2,..,dhr13 not in 1:21 into 0scchdg AND scfamg AND scchdh AND scchdi AND scfami in (-9,NA) AND dhr2 AND,..., AND dhr13 in (-8,-9,96,NA) into 999scchdg AND scfamg AND scchdh AND scchdi AND scfami AND dhr2 AND,.., AND dhr13 = -1 into 996R script:
ELSA_ds_w1 <- tibble(id = ELSA_w1_cont_rel$id)
ELSA_w1_cont_rel$scchdg <- car::recode(as.vector(ELSA_w1_cont_rel$scchdg), "NA='-999'")
ELSA_w1_cont_rel$scfamg <- car::recode(as.vector(ELSA_w1_cont_rel$scfamg), "NA='-999'")
ELSA_w1_cont_rel$scchdh <- car::recode(as.vector(ELSA_w1_cont_rel$scchdh), "NA='-999'")
ELSA_w1_cont_rel$scchdi <- car::recode(as.vector(ELSA_w1_cont_rel$scchdi), "NA='-999'")
ELSA_w1_cont_rel$scfami <- car::recode(as.vector(ELSA_w1_cont_rel$scfami), "NA='-999'")
ELSA_w1_cont_rel$dhr2 <- car::recode(as.vector(ELSA_w1_cont_rel$dhr2), "NA='-999'")
ELSA_w1_cont_rel$dhr3 <- car::recode(as.vector(ELSA_w1_cont_rel$dhr3), "NA='-999'")
ELSA_w1_cont_rel$dhr4 <- car::recode(as.vector(ELSA_w1_cont_rel$dhr4), "NA='-999'")
ELSA_w1_cont_rel$dhr5 <- car::recode(as.vector(ELSA_w1_cont_rel$dhr5), "NA='-999'")
ELSA_w1_cont_rel$dhr6 <- car::recode(as.vector(ELSA_w1_cont_rel$dhr6), "NA='-999'")
ELSA_w1_cont_rel$dhr7 <- car::recode(as.vector(ELSA_w1_cont_rel$dhr7), "NA='-999'")
ELSA_w1_cont_rel$dhr8 <- car::recode(as.vector(ELSA_w1_cont_rel$dhr8), "NA='-999'")
ELSA_w1_cont_rel$dhr9 <- car::recode(as.vector(ELSA_w1_cont_rel$dhr9), "NA='-999'")
ELSA_w1_cont_rel$dhr10 <- car::recode(as.vector(ELSA_w1_cont_rel$dhr10), "NA='-999'")
ELSA_w1_cont_rel$dhr11 <- car::recode(as.vector(ELSA_w1_cont_rel$dhr11), "NA='-999'")
ELSA_w1_cont_rel$dhr12 <- car::recode(as.vector(ELSA_w1_cont_rel$dhr12), "NA='-999'")
ELSA_w1_cont_rel$dhr13 <- car::recode(as.vector(ELSA_w1_cont_rel$dhr13), "NA='-999'")
ELSA_ds_w1$cont_rel <- c(NA)
for (i in 1:dim(ELSA_w1_cont_rel)[1]) {
if (ELSA_w1_cont_rel$scchdg[i] %in% c(1, 2, 3) | ELSA_w1_cont_rel$scfamg[i] %in%
c(1, 2, 3) | ELSA_w1_cont_rel$scchdh[i] %in% c(1, 2) | ELSA_w1_cont_rel$scchdi[i] %in%
c(1, 2) | ELSA_w1_cont_rel$scfami[i] %in% c(1, 2) | ELSA_w1_cont_rel$dhr2[i] %in%
c(1:21) | ELSA_w1_cont_rel$dhr3[i] %in% c(1:21) | ELSA_w1_cont_rel$dhr4[i] %in%
c(1:21) | ELSA_w1_cont_rel$dhr5[i] %in% c(1:21) | ELSA_w1_cont_rel$dhr6[i] %in%
c(1:21) | ELSA_w1_cont_rel$dhr7[i] %in% c(1:21) | ELSA_w1_cont_rel$dhr8[i] %in%
c(1:21) | ELSA_w1_cont_rel$dhr9[i] %in% c(1:21) | ELSA_w1_cont_rel$dhr10[i] %in%
c(1:21) | ELSA_w1_cont_rel$dhr11[i] %in% c(1:21) | ELSA_w1_cont_rel$dhr12[i] %in%
c(1:21) | ELSA_w1_cont_rel$dhr13[i] %in% c(1:21)) {
ELSA_ds_w1$cont_rel[i] = 1
} else if (ELSA_w1_cont_rel$scchdg[i] %in% c(-9, -999) & ELSA_w1_cont_rel$scfamg[i] %in%
c(-9, -999) & ELSA_w1_cont_rel$scchdh[i] %in% c(-9, -999) & ELSA_w1_cont_rel$scchdi[i] %in%
c(-9, -999) & ELSA_w1_cont_rel$scfami[i] %in% c(-9, -999) & ELSA_w1_cont_rel$dhr2[i] %in%
c(96, -8, -9, -999) & ELSA_w1_cont_rel$dhr3[i] %in% c(96, -8, -9, -999) &
ELSA_w1_cont_rel$dhr4[i] %in% c(96, -8, -9, -999) & ELSA_w1_cont_rel$dhr5[i] %in%
c(96, -8, -9, -999) & ELSA_w1_cont_rel$dhr6[i] %in% c(96, -8, -9, -999) &
ELSA_w1_cont_rel$dhr7[i] %in% c(96, -8, -9, -999) & ELSA_w1_cont_rel$dhr8[i] %in%
c(96, -8, -9, -999) & ELSA_w1_cont_rel$dhr9[i] %in% c(96, -8, -9, -999) &
ELSA_w1_cont_rel$dhr10[i] %in% c(96, -8, -9, -999) & ELSA_w1_cont_rel$dhr11[i] %in%
c(96, -8, -9, -999) & ELSA_w1_cont_rel$dhr12[i] %in% c(96, -8, -9, -999) &
ELSA_w1_cont_rel$dhr13[i] %in% c(96, -8, -9, -999)) {
ELSA_ds_w1$cont_rel[i] = 999
} else if (ELSA_w1_cont_rel$scchdg[i] == -1 & ELSA_w1_cont_rel$scfamg[i] ==
-1 & ELSA_w1_cont_rel$scchdh[i] == -1 & ELSA_w1_cont_rel$scchdi[i] ==
-1 & ELSA_w1_cont_rel$scfami[i] == -1 & ELSA_w1_cont_rel$dhr2[i] ==
-1 & ELSA_w1_cont_rel$dhr3[i] == -1 & ELSA_w1_cont_rel$dhr4[i] == -1 &
ELSA_w1_cont_rel$dhr5[i] == -1 & ELSA_w1_cont_rel$dhr6[i] == -1 & ELSA_w1_cont_rel$dhr7[i] ==
-1 & ELSA_w1_cont_rel$dhr8[i] == -1 & ELSA_w1_cont_rel$dhr9[i] == -1 &
ELSA_w1_cont_rel$dhr10[i] == -1 & ELSA_w1_cont_rel$dhr11[i] == -1 &
ELSA_w1_cont_rel$dhr12[i] == -1 & ELSA_w1_cont_rel$dhr13[i] == -1) {
ELSA_ds_w1$cont_rel[i] = 996
} else if (ELSA_w1_cont_rel$scchdg[i] %in% c(4, 5, 6) & ELSA_w1_cont_rel$scfamg[i] %in%
c(4, 5, 6) & ELSA_w1_cont_rel$scchdh[i] %in% c(3, 4, 5, 6) & ELSA_w1_cont_rel$scchdi[i] %in%
c(3, 4, 5, 6) & ELSA_w1_cont_rel$scfami[i] %in% c(3, 4, 5, 6) & !(ELSA_w1_cont_rel$dhr2[i] %in%
c(1:21) | ELSA_w1_cont_rel$dhr3[i] %in% c(1:21) | ELSA_w1_cont_rel$dhr4[i] %in%
c(1:21) | ELSA_w1_cont_rel$dhr5[i] %in% c(1:21) | ELSA_w1_cont_rel$dhr6[i] %in%
c(1:21) | ELSA_w1_cont_rel$dhr7[i] %in% c(1:21) | ELSA_w1_cont_rel$dhr8[i] %in%
c(1:21) | ELSA_w1_cont_rel$dhr9[i] %in% c(1:21) | ELSA_w1_cont_rel$dhr10[i] %in%
c(1:21) | ELSA_w1_cont_rel$dhr11[i] %in% c(1:21) | ELSA_w1_cont_rel$dhr12[i] %in%
c(1:21) | ELSA_w1_cont_rel$dhr13[i] %in% c(1:21))) {
ELSA_ds_w1$cont_rel[i] = 0
}
}
ELSA_ds_w1$cont_rel <- car::recode(as.vector(ELSA_ds_w1$cont_rel), "NA='999'")
ELSA_ds_w1$cont_rel <- labelled(ELSA_ds_w1$cont_rel, labels = c(No = 0, Yes = 1,
Missing = 999, `Do not know` = 998, Refuse = 997, `Not applicable` = 996,
`Don't answer` = 995, `Not attempt/not done/not yet recorded` = 994, `Disable to measure` = 993,
Impute = 992, `CAPI/interviewer error` = 991))
|
|
|
The study-specific variable elected to be harmonised is:
scchdgOn average how often do you meet up with your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-1 = Item not applicablescfamgOn average how often meet up with family members1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-1 = Item not applicablescchdhon average how often do you speak on the phone to your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-1 = Item not applicablescchdion average how often do you write or email your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-1 = Item not applicablescfamhHow often the respondent speaks with other relatives on the phone1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-1 = Item not applicablescfamion average how often do you write or email family members1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-1 = Item not applicableDhR12 UP TO DhR12Relationship of this person to Person 2 in the household1 = Husband/Wife2 = Partner/cohabitee3 = Natural son/daughter4 = Adopted son/daughter5 = Foster son/daughter6 = Step son/daughter/child of partner7 = Son/daughter-in-law8 = Natural parent9 = Adoptive parent10 = Foster parent11 = Stepparent/parent s partner12 = Parent-in-law13 = Natural brother/sister14 = Half-brother/sister15 = Step-brother/sister16 = Adopted brother/sister17 = Foster brother/sister18 = Brother/sister-in-law19 = Grandchild20 = Grandparent21 = Other relative22 = Other non-relative96 = (THIS CODE NOT USED)-9 = Refusal-8 = Don't Know-1 = Not applicable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To compute the harmonize variable from the study-specific variable it has to be recoded as follows: * scchdg OR scfamg in {1,2,3} OR scchdh OR scchdi OR scfamh OR scfami in {1,2} OR any of DhR2,..,DhR12 in 1:21 into 1 * scchdg AND scfamg in {4,5,6} AND scchdh AND scchdi AND scfamh AND scfami in {3,4,5,6} AND all DhR2,..,DhR12 not in 1:21 into 0 * scchdg AND scfamg AND scchdh AND scchdi AND scfami in (-9,NA) AND DhR2 AND,..., AND DhR13 in (-8,-9,96,NA) into 999 * scchdg AND scfamg AND scchdh AND scchdi AND scfami AND DhR2 AND,.., AND DhR13 = -1 into 996
R script:
ELSA_ds_w2 <- tibble(id = ELSA_w2_cont_rel$id)
ELSA_w2_cont_rel$scchdg <- car::recode(as.vector(ELSA_w2_cont_rel$scchdg), "NA='-999'")
ELSA_w2_cont_rel$scfamg <- car::recode(as.vector(ELSA_w2_cont_rel$scfamg), "NA='-999'")
ELSA_w2_cont_rel$scchdh <- car::recode(as.vector(ELSA_w2_cont_rel$scchdh), "NA='-999'")
ELSA_w2_cont_rel$scchdi <- car::recode(as.vector(ELSA_w2_cont_rel$scchdi), "NA='-999'")
ELSA_w2_cont_rel$scfami <- car::recode(as.vector(ELSA_w2_cont_rel$scfamh), "NA='-999'")
ELSA_w2_cont_rel$scfami <- car::recode(as.vector(ELSA_w2_cont_rel$scfami), "NA='-999'")
ELSA_w2_cont_rel$DhR2 <- car::recode(as.vector(ELSA_w2_cont_rel$DhR2), "NA='-999'")
ELSA_w2_cont_rel$DhR3 <- car::recode(as.vector(ELSA_w2_cont_rel$DhR3), "NA='-999'")
ELSA_w2_cont_rel$DhR4 <- car::recode(as.vector(ELSA_w2_cont_rel$DhR4), "NA='-999'")
ELSA_w2_cont_rel$DhR5 <- car::recode(as.vector(ELSA_w2_cont_rel$DhR5), "NA='-999'")
ELSA_w2_cont_rel$DhR6 <- car::recode(as.vector(ELSA_w2_cont_rel$DhR6), "NA='-999'")
ELSA_w2_cont_rel$DhR7 <- car::recode(as.vector(ELSA_w2_cont_rel$DhR7), "NA='-999'")
ELSA_w2_cont_rel$DhR8 <- car::recode(as.vector(ELSA_w2_cont_rel$DhR8), "NA='-999'")
ELSA_w2_cont_rel$DhR9 <- car::recode(as.vector(ELSA_w2_cont_rel$DhR9), "NA='-999'")
ELSA_w2_cont_rel$DhR10 <- car::recode(as.vector(ELSA_w2_cont_rel$DhR10), "NA='-999'")
ELSA_w2_cont_rel$DhR11 <- car::recode(as.vector(ELSA_w2_cont_rel$DhR11), "NA='-999'")
ELSA_w2_cont_rel$DhR12 <- car::recode(as.vector(ELSA_w2_cont_rel$DhR12), "NA='-999'")
ELSA_ds_w2$cont_rel <- c(NA)
for (i in 1:dim(ELSA_w2_cont_rel)[1]) {
if (ELSA_w2_cont_rel$scchdg[i] %in% c(1, 2, 3) | ELSA_w2_cont_rel$scfamg[i] %in%
c(1, 2, 3) | ELSA_w2_cont_rel$scchdh[i] %in% c(1, 2) | ELSA_w2_cont_rel$scchdi[i] %in%
c(1, 2) | ELSA_w2_cont_rel$scfamh[i] %in% c(1, 2) | ELSA_w2_cont_rel$scfami[i] %in%
c(1, 2) | ELSA_w2_cont_rel$DhR2[i] %in% c(1:21) | ELSA_w2_cont_rel$DhR3[i] %in%
c(1:21) | ELSA_w2_cont_rel$DhR4[i] %in% c(1:21) | ELSA_w2_cont_rel$DhR5[i] %in%
c(1:21) | ELSA_w2_cont_rel$DhR6[i] %in% c(1:21) | ELSA_w2_cont_rel$DhR7[i] %in%
c(1:21) | ELSA_w2_cont_rel$DhR8[i] %in% c(1:21) | ELSA_w2_cont_rel$DhR9[i] %in%
c(1:21) | ELSA_w2_cont_rel$DhR10[i] %in% c(1:21) | ELSA_w2_cont_rel$DhR11[i] %in%
c(1:21) | ELSA_w2_cont_rel$DhR12[i] %in% c(1:21)) {
ELSA_ds_w2$cont_rel[i] = 1
} else if (ELSA_w2_cont_rel$scchdg[i] %in% c(-9, -999) & ELSA_w2_cont_rel$scfamg[i] %in%
c(-9, -999) & ELSA_w2_cont_rel$scchdh[i] %in% c(-9, -999) & ELSA_w2_cont_rel$scchdi[i] %in%
c(-9, -999) & ELSA_w2_cont_rel$scfamh[i] %in% c(-9, -999) & ELSA_w2_cont_rel$scfami[i] %in%
c(-9, -999) & ELSA_w2_cont_rel$DhR2[i] %in% c(96, -8, -9, -999) & ELSA_w2_cont_rel$DhR3[i] %in%
c(96, -8, -9, -999) & ELSA_w2_cont_rel$DhR4[i] %in% c(96, -8, -9, -999) &
ELSA_w2_cont_rel$DhR5[i] %in% c(96, -8, -9, -999) & ELSA_w2_cont_rel$DhR6[i] %in%
c(96, -8, -9, -999) & ELSA_w2_cont_rel$DhR7[i] %in% c(96, -8, -9, -999) &
ELSA_w2_cont_rel$DhR8[i] %in% c(96, -8, -9, -999) & ELSA_w2_cont_rel$DhR9[i] %in%
c(96, -8, -9, -999) & ELSA_w2_cont_rel$DhR10[i] %in% c(96, -8, -9, -999) &
ELSA_w2_cont_rel$DhR11[i] %in% c(96, -8, -9, -999) & ELSA_w2_cont_rel$DhR12[i] %in%
c(96, -8, -9, -999)) {
ELSA_ds_w2$cont_rel[i] = 999
} else if (ELSA_w2_cont_rel$scchdg[i] == -1 & ELSA_w2_cont_rel$scfamg[i] ==
-1 & ELSA_w2_cont_rel$scchdh[i] == -1 & ELSA_w2_cont_rel$scchdi[i] ==
-1 & ELSA_w2_cont_rel$scfamh[i] == -1 & ELSA_w2_cont_rel$scfami[i] ==
-1 & ELSA_w2_cont_rel$DhR2[i] == -1 & ELSA_w2_cont_rel$DhR3[i] == -1 &
ELSA_w2_cont_rel$DhR4[i] == -1 & ELSA_w2_cont_rel$DhR5[i] == -1 & ELSA_w2_cont_rel$DhR6[i] ==
-1 & ELSA_w2_cont_rel$DhR7[i] == -1 & ELSA_w2_cont_rel$DhR8[i] == -1 &
ELSA_w2_cont_rel$DhR9[i] == -1 & ELSA_w2_cont_rel$DhR10[i] == -1 & ELSA_w2_cont_rel$DhR11[i] ==
-1 & ELSA_w2_cont_rel$DhR12[i] == -1) {
ELSA_ds_w2$cont_rel[i] = 996
} else if (ELSA_w2_cont_rel$scchdg[i] %in% c(4, 5, 6) & ELSA_w2_cont_rel$scfamg[i] %in%
c(4, 5, 6) & ELSA_w2_cont_rel$scchdh[i] %in% c(3, 4, 5, 6) & ELSA_w2_cont_rel$scchdi[i] %in%
c(3, 4, 5, 6) & ELSA_w2_cont_rel$scfamh[i] %in% c(3, 4, 5, 6) & ELSA_w2_cont_rel$scfami[i] %in%
c(3, 4, 5, 6) & !(ELSA_w2_cont_rel$DhR2[i] %in% c(1:21) | ELSA_w2_cont_rel$DhR3[i] %in%
c(1:21) | ELSA_w2_cont_rel$DhR4[i] %in% c(1:21) | ELSA_w2_cont_rel$DhR5[i] %in%
c(1:21) | ELSA_w2_cont_rel$DhR6[i] %in% c(1:21) | ELSA_w2_cont_rel$DhR7[i] %in%
c(1:21) | ELSA_w2_cont_rel$DhR8[i] %in% c(1:21) | ELSA_w2_cont_rel$DhR9[i] %in%
c(1:21) | ELSA_w2_cont_rel$DhR10[i] %in% c(1:21) | ELSA_w2_cont_rel$DhR11[i] %in%
c(1:21) | ELSA_w2_cont_rel$DhR12[i] %in% c(1:21))) {
ELSA_ds_w2$cont_rel[i] = 0
}
}
ELSA_ds_w2$cont_rel <- car::recode(as.vector(ELSA_ds_w2$cont_rel), "NA='999'")
ELSA_ds_w2$cont_rel <- labelled(ELSA_ds_w2$cont_rel, labels = c(No = 0, Yes = 1,
Missing = 999, `Do not know` = 998, Refuse = 997, `Not applicable` = 996,
`Don't answer` = 995, `Not attempt/not done/not yet recorded` = 994, `Disable to measure` = 993,
Impute = 992, `CAPI/interviewer error` = 991))
|
|
|
The study-specific variable elected to be harmonised is:
scchdgOn average how often do you meet up with your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-1 = Item not applicablescfamgOn average how often meet up with family members1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-1 = Item not applicablescchdhon average how often do you speak on the phone to your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-1 = Item not applicablescchdion average how often do you write or email your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-1 = Item not applicablescfamhHow often the respondent speaks with other relatives on the phone1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-1 = Item not applicablescfamion average how often do you write or email family members1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-1 = Item not applicabledhr1 UP TO dhr12Relationship of this person to Person 2 in the household1 = Husband/Wife2 = Partner/cohabitee3 = Natural son/daughter4 = Adopted son/daughter5 = Foster son/daughter6 = Step son/daughter/child of partner7 = Son/daughter-in-law8 = Natural parent9 = Adoptive parent10 = Foster parent11 = Stepparent/parent s partner12 = Parent-in-law13 = Natural brother/sister14 = Half-brother/sister15 = Step-brother/sister16 = Adopted brother/sister17 = Foster brother/sister18 = Brother/sister-in-law19 = Grandchild20 = Grandparent21 = Other relative22 = Other non-relative96 = (THIS CODE NOT USED)-9 = Refusal-8 = Don't Know-2 = Schedule not applicable-1 = Not applicable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To compute the harmonize variable from the study-specific variable it has to be recoded as follows:
scchdg OR scfamg in {1,2,3} OR scchdh OR scchdi OR scfamh OR scfami in {1,2} OR any of dhr2,..,dhr12 in 1:21 into 1scchdg AND scfamg in {4,5,6} AND scchdh AND scchdi AND scfamh AND scfami in {3,4,5,6} AND all dhr2,..,dhr12 not in 1:21 into 0scchdg AND scfamg AND scchdh AND scchdi AND scfamh AND scfami in (-9,NA) AND dhr2 AND,..., AND dhr12 in (-8,-9,96,NA) into 999scchdg AND scfamg AND scchdh AND scchdi AND scfamh AND scfami AND dhr2 AND,.., AND dhr12 in (-1,-2) into 996R script:
ELSA_ds_w3 <- tibble(id = ELSA_w3_cont_rel$id)
ELSA_w3_cont_rel$scchdg <- car::recode(as.vector(ELSA_w3_cont_rel$scchdg), "NA='-999'")
ELSA_w3_cont_rel$scfamg <- car::recode(as.vector(ELSA_w3_cont_rel$scfamg), "NA='-999'")
ELSA_w3_cont_rel$scchdh <- car::recode(as.vector(ELSA_w3_cont_rel$scchdh), "NA='-999'")
ELSA_w3_cont_rel$scchdi <- car::recode(as.vector(ELSA_w3_cont_rel$scchdi), "NA='-999'")
ELSA_w3_cont_rel$scfami <- car::recode(as.vector(ELSA_w3_cont_rel$scfami), "NA='-999'")
ELSA_w3_cont_rel$dhr2 <- car::recode(as.vector(ELSA_w3_cont_rel$dhr2), "NA='-999'")
ELSA_w3_cont_rel$dhr3 <- car::recode(as.vector(ELSA_w3_cont_rel$dhr3), "NA='-999'")
ELSA_w3_cont_rel$dhr4 <- car::recode(as.vector(ELSA_w3_cont_rel$dhr4), "NA='-999'")
ELSA_w3_cont_rel$dhr5 <- car::recode(as.vector(ELSA_w3_cont_rel$dhr5), "NA='-999'")
ELSA_w3_cont_rel$dhr6 <- car::recode(as.vector(ELSA_w3_cont_rel$dhr6), "NA='-999'")
ELSA_w3_cont_rel$dhr7 <- car::recode(as.vector(ELSA_w3_cont_rel$dhr7), "NA='-999'")
ELSA_w3_cont_rel$dhr8 <- car::recode(as.vector(ELSA_w3_cont_rel$dhr8), "NA='-999'")
ELSA_w3_cont_rel$dhr9 <- car::recode(as.vector(ELSA_w3_cont_rel$dhr9), "NA='-999'")
ELSA_w3_cont_rel$dhr10 <- car::recode(as.vector(ELSA_w3_cont_rel$dhr10), "NA='-999'")
ELSA_w3_cont_rel$dhr11 <- car::recode(as.vector(ELSA_w3_cont_rel$dhr11), "NA='-999'")
ELSA_w3_cont_rel$dhr12 <- car::recode(as.vector(ELSA_w3_cont_rel$dhr12), "NA='-999'")
ELSA_ds_w3$cont_rel <- c(NA)
for (i in 1:dim(ELSA_w3_cont_rel)[1]) {
if (ELSA_w3_cont_rel$scchdg[i] %in% c(1, 2, 3) | ELSA_w3_cont_rel$scfamg[i] %in%
c(1, 2, 3) | ELSA_w3_cont_rel$scchdh[i] %in% c(1, 2) | ELSA_w3_cont_rel$scchdi[i] %in%
c(1, 2) | ELSA_w3_cont_rel$scfamh[i] %in% c(1, 2) | ELSA_w3_cont_rel$scfami[i] %in%
c(1, 2) | ELSA_w3_cont_rel$dhr2[i] %in% c(1:21) | ELSA_w3_cont_rel$dhr3[i] %in%
c(1:21) | ELSA_w3_cont_rel$dhr4[i] %in% c(1:21) | ELSA_w3_cont_rel$dhr5[i] %in%
c(1:21) | ELSA_w3_cont_rel$dhr6[i] %in% c(1:21) | ELSA_w3_cont_rel$dhr7[i] %in%
c(1:21) | ELSA_w3_cont_rel$dhr8[i] %in% c(1:21) | ELSA_w3_cont_rel$dhr9[i] %in%
c(1:21) | ELSA_w3_cont_rel$dhr10[i] %in% c(1:21) | ELSA_w3_cont_rel$dhr11[i] %in%
c(1:21) | ELSA_w3_cont_rel$dhr12[i] %in% c(1:21)) {
ELSA_ds_w3$cont_rel[i] = 1
} else if (ELSA_w3_cont_rel$scchdg[i] %in% c(-9, -999) & ELSA_w3_cont_rel$scfamg[i] %in%
c(-9, -999) & ELSA_w3_cont_rel$scchdh[i] %in% c(-9, -999) & ELSA_w3_cont_rel$scchdi[i] %in%
c(-9, -999) & ELSA_w3_cont_rel$scfamh[i] %in% c(-9, -999) & ELSA_w3_cont_rel$scfami[i] %in%
c(-9, -999) & ELSA_w3_cont_rel$dhr2[i] %in% c(96, -8, -9, -999) & ELSA_w3_cont_rel$dhr3[i] %in%
c(96, -8, -9, -999) & ELSA_w3_cont_rel$dhr4[i] %in% c(96, -8, -9, -999) &
ELSA_w3_cont_rel$dhr5[i] %in% c(96, -8, -9, -999) & ELSA_w3_cont_rel$dhr6[i] %in%
c(96, -8, -9, -999) & ELSA_w3_cont_rel$dhr7[i] %in% c(96, -8, -9, -999) &
ELSA_w3_cont_rel$dhr8[i] %in% c(96, -8, -9, -999) & ELSA_w3_cont_rel$dhr9[i] %in%
c(96, -8, -9, -999) & ELSA_w3_cont_rel$dhr10[i] %in% c(96, -8, -9, -999) &
ELSA_w3_cont_rel$dhr11[i] %in% c(96, -8, -9, -999) & ELSA_w3_cont_rel$dhr12[i] %in%
c(96, -8, -9, -999)) {
ELSA_ds_w3$cont_rel[i] = 999
} else if (ELSA_w3_cont_rel$scchdg[i] == -1 & ELSA_w3_cont_rel$scfamg[i] ==
-1 & ELSA_w3_cont_rel$scchdh[i] == -1 & ELSA_w3_cont_rel$scchdi[i] ==
-1 & ELSA_w3_cont_rel$scfamh[i] == -1 & ELSA_w3_cont_rel$scfami[i] ==
-1 & ELSA_w3_cont_rel$dhr2[i] %in% c(-1, -2) & ELSA_w3_cont_rel$dhr3[i] %in%
c(-1, -2) & ELSA_w3_cont_rel$dhr4[i] %in% c(-1, -2) & ELSA_w3_cont_rel$dhr5[i] %in%
c(-1, -2) & ELSA_w3_cont_rel$dhr6[i] %in% c(-1, -2) & ELSA_w3_cont_rel$dhr7[i] %in%
c(-1, -2) & ELSA_w3_cont_rel$dhr8[i] %in% c(-1, -2) & ELSA_w3_cont_rel$dhr9[i] %in%
c(-1, -2) & ELSA_w3_cont_rel$dhr10[i] %in% c(-1, -2) & ELSA_w3_cont_rel$dhr11[i] %in%
c(-1, -2) & ELSA_w3_cont_rel$dhr12[i] %in% c(-1, -2)) {
ELSA_ds_w3$cont_rel[i] = 996
} else if (ELSA_w3_cont_rel$scchdg[i] %in% c(4, 5, 6) & ELSA_w3_cont_rel$scfamg[i] %in%
c(4, 5, 6) & ELSA_w3_cont_rel$scchdh[i] %in% c(3, 4, 5, 6) & ELSA_w3_cont_rel$scchdi[i] %in%
c(3, 4, 5, 6) & ELSA_w3_cont_rel$scfamh[i] %in% c(3, 4, 5, 6) & ELSA_w3_cont_rel$scfami[i] %in%
c(3, 4, 5, 6) & !(ELSA_w3_cont_rel$dhr2[i] %in% c(1:21) | ELSA_w3_cont_rel$dhr3[i] %in%
c(1:21) | ELSA_w3_cont_rel$dhr4[i] %in% c(1:21) | ELSA_w3_cont_rel$dhr5[i] %in%
c(1:21) | ELSA_w3_cont_rel$dhr6[i] %in% c(1:21) | ELSA_w3_cont_rel$dhr7[i] %in%
c(1:21) | ELSA_w3_cont_rel$dhr8[i] %in% c(1:21) | ELSA_w3_cont_rel$dhr9[i] %in%
c(1:21) | ELSA_w3_cont_rel$dhr10[i] %in% c(1:21) | ELSA_w3_cont_rel$dhr11[i] %in%
c(1:21) | ELSA_w3_cont_rel$dhr12[i] %in% c(1:21))) {
ELSA_ds_w3$cont_rel[i] = 0
}
}
ELSA_ds_w3$cont_rel <- car::recode(as.vector(ELSA_ds_w3$cont_rel), "NA='999'")
ELSA_ds_w3$cont_rel <- labelled(ELSA_ds_w3$cont_rel, labels = c(No = 0, Yes = 1,
Missing = 999, `Do not know` = 998, Refuse = 997, `Not applicable` = 996,
`Don't answer` = 995, `Not attempt/not done/not yet recorded` = 994, `Disable to measure` = 993,
Impute = 992, `CAPI/interviewer error` = 991))
|
|
|
The study-specific variable elected to be harmonised is:
scchdgOn average how often do you meet up with your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-1 = Item not applicablescfamgOn average how often meet up with family members1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-1 = Item not applicablescchdhon average how often do you speak on the phone to your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-1 = Item not applicablescchdion average how often do you write or email your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-1 = Item not applicablescfamiHow often the respondent writes to or emails other relatives1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-1 = Item not applicabledhr2 UP TO dhr12 (dhr13 to dhr16 have NA or -1 only)Relationship of this person to Person 1 in the household1 = Husband/Wife2 = Partner/cohabitee3 = Natural son/daughter4 = Adopted son/daughter5 = Foster son/daughter6 = Step son/daughter/child of partner7 = Son/daughter-in-law8 = Natural parent9 = Adoptive parent10 = Foster parent11 = Stepparent/parent s partner12 = Parent-in-law13 = Natural brother/sister14 = Half-brother/sister15 = Step-brother/sister16 = Adopted brother/sister17 = Foster brother/sister18 = Brother/sister-in-law19 = Grandchild20 = Grandparent21 = Other relative22 = Other non-relative96 = (THIS CODE NOT USED)-9 = Refusal-8 = Don't Know-2 = Schedule not applicable-1 = Not applicable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To compute the harmonize variable from the study-specific variable it has to be recoded as follows:
scchdg OR scfamg in {1,2,3} OR scchdh OR scchdi OR scfami in {1,2} OR any of dhr2,..,dhr12 in 1:21 into 1scchdg AND scfamg in {4,5,6} AND scchdh AND scchdi AND scfami in {3,4,5,6} AND all dhr2,..,dhr12 not in 1:21 into 0scchdg AND scfamg AND scchdh AND scchdi AND scfami in (-9,NA) AND dhr2 AND,..., AND dhr12 in (-8,-9,96,NA) into 999scchdg AND scfamg AND scchdh AND scchdi AND scfami AND dhr2 AND,.., AND dhr12 in (-1, -2) into 996R script:
ELSA_ds_w4 <- tibble(id = ELSA_w4_cont_rel$id)
ELSA_w4_cont_rel$scchdg <- car::recode(as.vector(ELSA_w4_cont_rel$scchdg), "NA='-999'")
ELSA_w4_cont_rel$scfamg <- car::recode(as.vector(ELSA_w4_cont_rel$scfamg), "NA='-999'")
ELSA_w4_cont_rel$scchdh <- car::recode(as.vector(ELSA_w4_cont_rel$scchdh), "NA='-999'")
ELSA_w4_cont_rel$scchdi <- car::recode(as.vector(ELSA_w4_cont_rel$scchdi), "NA='-999'")
ELSA_w4_cont_rel$scfami <- car::recode(as.vector(ELSA_w4_cont_rel$scfami), "NA='-999'")
ELSA_w4_cont_rel$dhr2 <- car::recode(as.vector(ELSA_w4_cont_rel$dhr2), "NA='-999'")
ELSA_w4_cont_rel$dhr3 <- car::recode(as.vector(ELSA_w4_cont_rel$dhr3), "NA='-999'")
ELSA_w4_cont_rel$dhr4 <- car::recode(as.vector(ELSA_w4_cont_rel$dhr4), "NA='-999'")
ELSA_w4_cont_rel$dhr5 <- car::recode(as.vector(ELSA_w4_cont_rel$dhr5), "NA='-999'")
ELSA_w4_cont_rel$dhr6 <- car::recode(as.vector(ELSA_w4_cont_rel$dhr6), "NA='-999'")
ELSA_w4_cont_rel$dhr7 <- car::recode(as.vector(ELSA_w4_cont_rel$dhr7), "NA='-999'")
ELSA_w4_cont_rel$dhr8 <- car::recode(as.vector(ELSA_w4_cont_rel$dhr8), "NA='-999'")
ELSA_w4_cont_rel$dhr9 <- car::recode(as.vector(ELSA_w4_cont_rel$dhr9), "NA='-999'")
ELSA_w4_cont_rel$dhr10 <- car::recode(as.vector(ELSA_w4_cont_rel$dhr10), "NA='-999'")
ELSA_w4_cont_rel$dhr11 <- car::recode(as.vector(ELSA_w4_cont_rel$dhr11), "NA='-999'")
ELSA_w4_cont_rel$dhr12 <- car::recode(as.vector(ELSA_w4_cont_rel$dhr12), "NA='-999'")
ELSA_ds_w4$cont_rel <- c(NA)
for (i in 1:dim(ELSA_w4_cont_rel)[1]) {
if (ELSA_w4_cont_rel$scchdg[i] %in% c(1, 2, 3) | ELSA_w4_cont_rel$scfamg[i] %in%
c(1, 2, 3) | ELSA_w4_cont_rel$scchdh[i] %in% c(1, 2) | ELSA_w4_cont_rel$scchdi[i] %in%
c(1, 2) | ELSA_w4_cont_rel$scfami[i] %in% c(1, 2) | ELSA_w4_cont_rel$dhr2[i] %in%
c(1:21) | ELSA_w4_cont_rel$dhr3[i] %in% c(1:21) | ELSA_w4_cont_rel$dhr4[i] %in%
c(1:21) | ELSA_w4_cont_rel$dhr5[i] %in% c(1:21) | ELSA_w4_cont_rel$dhr6[i] %in%
c(1:21) | ELSA_w4_cont_rel$dhr7[i] %in% c(1:21) | ELSA_w4_cont_rel$dhr8[i] %in%
c(1:21) | ELSA_w4_cont_rel$dhr9[i] %in% c(1:21) | ELSA_w4_cont_rel$dhr10[i] %in%
c(1:21) | ELSA_w4_cont_rel$dhr11[i] %in% c(1:21) | ELSA_w4_cont_rel$dhr12[i] %in%
c(1:21)) {
ELSA_ds_w4$cont_rel[i] = 1
} else if (ELSA_w4_cont_rel$scchdg[i] %in% c(-9, -999) & ELSA_w4_cont_rel$scfamg[i] %in%
c(-9, -999) & ELSA_w4_cont_rel$scchdh[i] %in% c(-9, -999) & ELSA_w4_cont_rel$scchdi[i] %in%
c(-9, -999) & ELSA_w4_cont_rel$scfami[i] %in% c(-9, -999) & ELSA_w4_cont_rel$dhr2[i] %in%
c(96, -8, -9, -999) & ELSA_w4_cont_rel$dhr3[i] %in% c(96, -8, -9, -999) &
ELSA_w4_cont_rel$dhr4[i] %in% c(96, -8, -9, -999) & ELSA_w4_cont_rel$dhr5[i] %in%
c(96, -8, -9, -999) & ELSA_w4_cont_rel$dhr6[i] %in% c(96, -8, -9, -999) &
ELSA_w4_cont_rel$dhr7[i] %in% c(96, -8, -9, -999) & ELSA_w4_cont_rel$dhr8[i] %in%
c(96, -8, -9, -999) & ELSA_w4_cont_rel$dhr9[i] %in% c(96, -8, -9, -999) &
ELSA_w4_cont_rel$dhr10[i] %in% c(96, -8, -9, -999) & ELSA_w4_cont_rel$dhr11[i] %in%
c(96, -8, -9, -999) & ELSA_w4_cont_rel$dhr12[i] %in% c(96, -8, -9, -999)) {
ELSA_ds_w4$cont_rel[i] = 999
} else if (ELSA_w4_cont_rel$scchdg[i] == -1 & ELSA_w4_cont_rel$scfamg[i] ==
-1 & ELSA_w4_cont_rel$scchdh[i] == -1 & ELSA_w4_cont_rel$scchdi[i] ==
-1 & ELSA_w4_cont_rel$scfami[i] == -1 & ELSA_w4_cont_rel$dhr2[i] %in%
c(-1, -2) & ELSA_w4_cont_rel$dhr3[i] %in% c(-1, -2) & ELSA_w4_cont_rel$dhr4[i] %in%
c(-1, -2) & ELSA_w4_cont_rel$dhr5[i] %in% c(-1, -2) & ELSA_w4_cont_rel$dhr6[i] %in%
c(-1, -2) & ELSA_w4_cont_rel$dhr7[i] %in% c(-1, -2) & ELSA_w4_cont_rel$dhr8[i] %in%
c(-1, -2) & ELSA_w4_cont_rel$dhr9[i] %in% c(-1, -2) & ELSA_w4_cont_rel$dhr10[i] %in%
c(-1, -2) & ELSA_w4_cont_rel$dhr11[i] %in% c(-1, -2) & ELSA_w4_cont_rel$dhr12[i] %in%
c(-1, -2)) {
ELSA_ds_w4$cont_rel[i] = 996
} else if (ELSA_w4_cont_rel$scchdg[i] %in% c(4, 5, 6) & ELSA_w4_cont_rel$scfamg[i] %in%
c(4, 5, 6) & ELSA_w4_cont_rel$scchdh[i] %in% c(3, 4, 5, 6) & ELSA_w4_cont_rel$scchdi[i] %in%
c(3, 4, 5, 6) & ELSA_w4_cont_rel$scfami[i] %in% c(3, 4, 5, 6) & !(ELSA_w4_cont_rel$dhr2[i] %in%
c(1:21) | ELSA_w4_cont_rel$dhr3[i] %in% c(1:21) | ELSA_w4_cont_rel$dhr4[i] %in%
c(1:21) | ELSA_w4_cont_rel$dhr5[i] %in% c(1:21) | ELSA_w4_cont_rel$dhr6[i] %in%
c(1:21) | ELSA_w4_cont_rel$dhr7[i] %in% c(1:21) | ELSA_w4_cont_rel$dhr8[i] %in%
c(1:21) | ELSA_w4_cont_rel$dhr9[i] %in% c(1:21) | ELSA_w4_cont_rel$dhr10[i] %in%
c(1:21) | ELSA_w4_cont_rel$dhr11[i] %in% c(1:21) | ELSA_w4_cont_rel$dhr12[i] %in%
c(1:21))) {
ELSA_ds_w4$cont_rel[i] = 0
}
}
ELSA_ds_w4$cont_rel <- car::recode(as.vector(ELSA_ds_w4$cont_rel), "NA='999'")
ELSA_ds_w4$cont_rel <- labelled(ELSA_ds_w4$cont_rel, labels = c(No = 0, Yes = 1,
Missing = 999, `Do not know` = 998, Refuse = 997, `Not applicable` = 996,
`Don't answer` = 995, `Not attempt/not done/not yet recorded` = 994, `Disable to measure` = 993,
Impute = 992, `CAPI/interviewer error` = 991))
|
|
|
The study-specific variable elected to be harmonised is:
scchdgOn average how often do you meet up with your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicablescfamgOn average how often meet up with family members1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicablescchdhon average how often do you speak on the phone to your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicablescchdion average how often do you write or email your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicablescfamhHow often the respondent speaks with other relatives on the phone1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicablescfamion average how often do you write or email family members1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicabledhr1 UP TO dhr16 (dhr13 to dhr16 have NA or -1 only)Relationship of this person to Person 1 in the household1 = Husband/Wife2 = Partner/cohabitee3 = Natural son/daughter4 = Adopted son/daughter5 = Foster son/daughter6 = Step son/daughter/child of partner7 = Son/daughter-in-law8 = Natural parent9 = Adoptive parent10 = Foster parent11 = Stepparent/parent s partner12 = Parent-in-law13 = Natural brother/sister14 = Half-brother/sister15 = Step-brother/sister16 = Adopted brother/sister17 = Foster brother/sister18 = Brother/sister-in-law19 = Grandchild20 = Grandparent21 = Other relative22 = Other non-relative96 = (THIS CODE NOT USED)-9 = Refusal-8 = Don't Know-2 = Schedule not applicable-1 = Not applicable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To compute the harmonize variable from the study-specific variable it has to be recoded as follows:
scchdg OR scfamg in {1,2,3} OR scchdh OR scchdi OR scfamh OR scfami in {1,2} OR any of dhr2,..,dhr16 in 1:21 into 1scchdg AND scfamg in {4,5,6} AND scchdh AND scchdi AND scfamh AND scfami in {3,4,5,6} AND all dhr2,..,dhr16 not in 1:21 into 0scchdg AND scfamg AND scchdh AND scchdi AND scfamh AND scfami in (-9,NA) AND dhr2 AND,..., AND dhr16 in (-8,-9,96,NA) into 999scchdg AND scfamg AND scchdh AND scchdi AND scfamh AND scfami AND dhr2 AND,.., AND dhr16 in (-1,-2) into 996R script:
ELSA_ds_w5 <- tibble(id = ELSA_w5_cont_rel$id)
ELSA_w5_cont_rel$scchdg <- car::recode(as.vector(ELSA_w5_cont_rel$scchdg), "NA='-999'")
ELSA_w5_cont_rel$scfamg <- car::recode(as.vector(ELSA_w5_cont_rel$scfamg), "NA='-999'")
ELSA_w5_cont_rel$scchdh <- car::recode(as.vector(ELSA_w5_cont_rel$scchdh), "NA='-999'")
ELSA_w5_cont_rel$scchdi <- car::recode(as.vector(ELSA_w5_cont_rel$scchdi), "NA='-999'")
ELSA_w5_cont_rel$scfami <- car::recode(as.vector(ELSA_w5_cont_rel$scfami), "NA='-999'")
ELSA_w5_cont_rel$dhr2 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr2), "NA='-999'")
ELSA_w5_cont_rel$dhr3 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr3), "NA='-999'")
ELSA_w5_cont_rel$dhr4 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr4), "NA='-999'")
ELSA_w5_cont_rel$dhr5 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr5), "NA='-999'")
ELSA_w5_cont_rel$dhr6 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr6), "NA='-999'")
ELSA_w5_cont_rel$dhr7 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr7), "NA='-999'")
ELSA_w5_cont_rel$dhr8 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr8), "NA='-999'")
ELSA_w5_cont_rel$dhr9 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr9), "NA='-999'")
ELSA_w5_cont_rel$dhr10 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr10), "NA='-999'")
ELSA_w5_cont_rel$dhr11 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr11), "NA='-999'")
ELSA_w5_cont_rel$dhr12 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr12), "NA='-999'")
ELSA_w5_cont_rel$dhr13 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr13), "NA='-999'")
ELSA_w5_cont_rel$dhr14 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr14), "NA='-999'")
ELSA_w5_cont_rel$dhr15 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr15), "NA='-999'")
ELSA_w5_cont_rel$dhr16 <- car::recode(as.vector(ELSA_w5_cont_rel$dhr16), "NA='-999'")
ELSA_ds_w5$cont_rel <- c(NA)
for (i in 1:dim(ELSA_w5_cont_rel)[1]) {
if (ELSA_w5_cont_rel$scchdg[i] %in% c(1, 2, 3) | ELSA_w5_cont_rel$scfamg[i] %in%
c(1, 2, 3) | ELSA_w5_cont_rel$scchdh[i] %in% c(1, 2) | ELSA_w5_cont_rel$scchdi[i] %in%
c(1, 2) | ELSA_w5_cont_rel$scfamh[i] %in% c(1, 2) | ELSA_w5_cont_rel$scfami[i] %in%
c(1, 2) | ELSA_w5_cont_rel$dhr2[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr3[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr4[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr5[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr6[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr7[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr8[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr9[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr10[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr11[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr12[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr13[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr14[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr15[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr16[i] %in% c(1:21)) {
ELSA_ds_w5$cont_rel[i] = 1
} else if (ELSA_w5_cont_rel$scchdg[i] %in% c(-9, -999) & ELSA_w5_cont_rel$scfamg[i] %in%
c(-9, -999) & ELSA_w5_cont_rel$scchdh[i] %in% c(-9, -999) & ELSA_w5_cont_rel$scchdi[i] %in%
c(-9, -999) & ELSA_w5_cont_rel$scfamh[i] %in% c(-9, -999) & ELSA_w5_cont_rel$scfami[i] %in%
c(-9, -999) & ELSA_w5_cont_rel$dhr2[i] %in% c(96, -8, -9, -999) & ELSA_w5_cont_rel$dhr3[i] %in%
c(96, -8, -9, -999) & ELSA_w5_cont_rel$dhr4[i] %in% c(96, -8, -9, -999) &
ELSA_w5_cont_rel$dhr5[i] %in% c(96, -8, -9, -999) & ELSA_w5_cont_rel$dhr6[i] %in%
c(96, -8, -9, -999) & ELSA_w5_cont_rel$dhr7[i] %in% c(96, -8, -9, -999) &
ELSA_w5_cont_rel$dhr8[i] %in% c(96, -8, -9, -999) & ELSA_w5_cont_rel$dhr9[i] %in%
c(96, -8, -9, -999) & ELSA_w5_cont_rel$dhr10[i] %in% c(96, -8, -9, -999) &
ELSA_w5_cont_rel$dhr11[i] %in% c(96, -8, -9, -999) & ELSA_w5_cont_rel$dhr12[i] %in%
c(96, -8, -9, -999) & ELSA_w5_cont_rel$dhr13[i] %in% c(96, -8, -9, -999) &
ELSA_w5_cont_rel$dhr14[i] %in% c(96, -8, -9, -999) & ELSA_w5_cont_rel$dhr15[i] %in%
c(96, -8, -9, -999) & ELSA_w5_cont_rel$dhr16[i] %in% c(96, -8, -9, -999)) {
ELSA_ds_w5$cont_rel[i] = 999
} else if (ELSA_w5_cont_rel$scchdg[i] == -1 & ELSA_w5_cont_rel$scfamg[i] ==
-1 & ELSA_w5_cont_rel$scchdh[i] == -1 & ELSA_w5_cont_rel$scchdi[i] ==
-1 & ELSA_w5_cont_rel$scfamh[i] == -1 & ELSA_w5_cont_rel$scfami[i] ==
-1 & ELSA_w5_cont_rel$dhr2[i] %in% c(-1, -2) & ELSA_w5_cont_rel$dhr3[i] %in%
c(-1, -2) & ELSA_w5_cont_rel$dhr4[i] %in% c(-1, -2) & ELSA_w5_cont_rel$dhr5[i] %in%
c(-1, -2) & ELSA_w5_cont_rel$dhr6[i] %in% c(-1, -2) & ELSA_w5_cont_rel$dhr7[i] %in%
c(-1, -2) & ELSA_w5_cont_rel$dhr8[i] %in% c(-1, -2) & ELSA_w5_cont_rel$dhr9[i] %in%
c(-1, -2) & ELSA_w5_cont_rel$dhr10[i] %in% c(-1, -2) & ELSA_w5_cont_rel$dhr11[i] %in%
c(-1, -2) & ELSA_w5_cont_rel$dhr12[i] %in% c(-1, -2) & ELSA_w5_cont_rel$dhr13[i] %in%
c(-1, -2) & ELSA_w5_cont_rel$dhr14[i] %in% c(-1, -2) & ELSA_w5_cont_rel$dhr15[i] %in%
c(-1, -2) & ELSA_w5_cont_rel$dhr16[i] %in% c(-1, -2)) {
ELSA_ds_w5$cont_rel[i] = 996
} else if (ELSA_w5_cont_rel$scchdg[i] %in% c(4, 5, 6) & ELSA_w5_cont_rel$scfamg[i] %in%
c(4, 5, 6) & ELSA_w5_cont_rel$scchdh[i] %in% c(3, 4, 5, 6) & ELSA_w5_cont_rel$scchdi[i] %in%
c(3, 4, 5, 6) & ELSA_w5_cont_rel$scfamh[i] %in% c(3, 4, 5, 6) & ELSA_w5_cont_rel$scfami[i] %in%
c(3, 4, 5, 6) & !(ELSA_w5_cont_rel$dhr2[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr3[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr4[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr5[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr6[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr7[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr8[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr9[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr10[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr11[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr12[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr13[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr14[i] %in% c(1:21) | ELSA_w5_cont_rel$dhr15[i] %in%
c(1:21) | ELSA_w5_cont_rel$dhr16[i] %in% c(1:21))) {
ELSA_ds_w5$cont_rel[i] = 0
}
}
ELSA_ds_w5$cont_rel <- car::recode(as.vector(ELSA_ds_w5$cont_rel), "NA='999'")
ELSA_ds_w5$cont_rel <- labelled(ELSA_ds_w5$cont_rel, labels = c(No = 0, Yes = 1,
Missing = 999, `Do not know` = 998, Refuse = 997, `Not applicable` = 996,
`Don't answer` = 995, `Not attempt/not done/not yet recorded` = 994, `Disable to measure` = 993,
Impute = 992, `CAPI/interviewer error` = 991))
|
|
|
The study-specific variable elected to be harmonised is:
scchdgOn average how often do you meet up with your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicablescfamgOn average how often meet up with family members1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicablescchdhon average how often do you speak on the phone to your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicablescchdion average how often do you write or email your children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicablescchdtHow often the respondent sends or receives text messages to/from their children1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicablescfamhHow often the respondent speaks with other relatives on the phone1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicablescfamion average how often do you write or email family members1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicablescfamtHow often the respondent sends or receives text messages to/from other relatives1 = Three or more times a week2 = Once or twice a week3 = Once or twice a month4 = Every few months5 = Once or twice a year6 = Less than once a year or never-9 = Not answered-8 = Don't know-2 = Schedule Not Applicable-1 = Item not applicabledhr1 UP TO dhr16 (dhr13 to dhr16 have NA or -1 only)Relationship of this person to Person 1 in the household1 = Husband/Wife2 = Partner/cohabitee3 = Natural son/daughter4 = Adopted son/daughter5 = Foster son/daughter6 = Step son/daughter/child of partner7 = Son/daughter-in-law8 = Natural parent9 = Adoptive parent10 = Foster parent11 = Stepparent/parent s partner12 = Parent-in-law13 = Natural brother/sister14 = Half-brother/sister15 = Step-brother/sister16 = Adopted brother/sister17 = Foster brother/sister18 = Brother/sister-in-law19 = Grandchild20 = Grandparent21 = Other relative22 = Other non-relative96 = (THIS CODE NOT USED)-9 = Refusal-8 = Don't Know-2 = Schedule not applicable-1 = Not applicable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To compute the harmonize variable from the study-specific variable it has to be recoded as follows:
scchdg OR scfamg in {1,2,3} OR scchdh OR scchdi OR scchdt OR scfamh OR scfami OR scfamt in {1,2} OR any of DhR2,..,DhR16 in 1:21 into 1scchdg AND scfamg in {4,5,6} AND scchdh AND scchdi AND scchdt AND scfamh AND scfami AND scfamt in {3,4,5,6} AND all DhR2,..,DhR16 not in 1:21 into 0scchdg AND scfamg AND scchdh AND scchdi AND scchdt AND scfamh AND scfami AND scfamt in (-9,NA) AND DhR2,..,DhR16 in (-9,96,NA) into 999scchdg AND scfamg AND scchdh AND scchdi AND scchdt AND scfamh AND scfami AND scfamt AND DhR2,..,DhR16 in (-1,-2) into 996scchdg AND scfamg AND scchdh AND scchdi AND scchdt AND scfamh AND scfami AND scfamt AND DhR2,..,DhR16 -8 into 998R script:
ELSA_ds_w6 <- tibble(id = ELSA_w6_cont_rel$id)
ELSA_w6_cont_rel$scchdg <- car::recode(as.vector(ELSA_w6_cont_rel$scchdg), "NA='-999'")
ELSA_w6_cont_rel$scfamg <- car::recode(as.vector(ELSA_w6_cont_rel$scfamg), "NA='-999'")
ELSA_w6_cont_rel$scchdh <- car::recode(as.vector(ELSA_w6_cont_rel$scchdh), "NA='-999'")
ELSA_w6_cont_rel$scchdi <- car::recode(as.vector(ELSA_w6_cont_rel$scchdi), "NA='-999'")
ELSA_w6_cont_rel$scchdt <- car::recode(as.vector(ELSA_w6_cont_rel$scchdt), "NA='-999'")
ELSA_w6_cont_rel$scfamh <- car::recode(as.vector(ELSA_w6_cont_rel$scfamh), "NA='-999'")
ELSA_w6_cont_rel$scfami <- car::recode(as.vector(ELSA_w6_cont_rel$scfami), "NA='-999'")
ELSA_w6_cont_rel$scfamt <- car::recode(as.vector(ELSA_w6_cont_rel$scfamt), "NA='-999'")
ELSA_w6_cont_rel$DhR2 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR2), "NA='-999'")
ELSA_w6_cont_rel$DhR3 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR3), "NA='-999'")
ELSA_w6_cont_rel$DhR4 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR4), "NA='-999'")
ELSA_w6_cont_rel$DhR5 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR5), "NA='-999'")
ELSA_w6_cont_rel$DhR6 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR6), "NA='-999'")
ELSA_w6_cont_rel$DhR7 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR7), "NA='-999'")
ELSA_w6_cont_rel$DhR8 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR8), "NA='-999'")
ELSA_w6_cont_rel$DhR9 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR9), "NA='-999'")
ELSA_w6_cont_rel$DhR10 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR10), "NA='-999'")
ELSA_w6_cont_rel$DhR11 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR11), "NA='-999'")
ELSA_w6_cont_rel$DhR12 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR12), "NA='-999'")
ELSA_w6_cont_rel$DhR13 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR13), "NA='-999'")
ELSA_w6_cont_rel$DhR14 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR14), "NA='-999'")
ELSA_w6_cont_rel$DhR15 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR15), "NA='-999'")
ELSA_w6_cont_rel$DhR16 <- car::recode(as.vector(ELSA_w6_cont_rel$DhR16), "NA='-999'")
ELSA_ds_w6$cont_rel <- c(NA)
for (i in 1:dim(ELSA_w6_cont_rel)[1]) {
if (ELSA_w6_cont_rel$scchdg[i] %in% c(1, 2, 3) | ELSA_w6_cont_rel$scfamg[i] %in%
c(1, 2, 3) | ELSA_w6_cont_rel$scchdh[i] %in% c(1, 2) | ELSA_w6_cont_rel$scchdi[i] %in%
c(1, 2) | ELSA_w6_cont_rel$scchdt[i] %in% c(1, 2) | ELSA_w6_cont_rel$scfamh[i] %in%
c(1, 2) | ELSA_w6_cont_rel$scfami[i] %in% c(1, 2) | ELSA_w6_cont_rel$scfamt[i] %in%
c(1, 2) | ELSA_w6_cont_rel$DhR2[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR3[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR4[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR5[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR6[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR7[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR8[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR9[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR10[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR11[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR12[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR13[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR14[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR15[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR16[i] %in% c(1:21)) {
ELSA_ds_w6$cont_rel[i] = 1
} else if (ELSA_w6_cont_rel$scchdg[i] %in% c(-9, -999) & ELSA_w6_cont_rel$scfamg[i] %in%
c(-9, -999) & ELSA_w6_cont_rel$scchdh[i] %in% c(-9, -999) & ELSA_w6_cont_rel$scchdi[i] %in%
c(-9, -999) & ELSA_w6_cont_rel$scchdt[i] %in% c(-9, -999) & ELSA_w6_cont_rel$scfamh[i] %in%
c(-9, -999) & ELSA_w6_cont_rel$scfami[i] %in% c(-9, -999) & ELSA_w6_cont_rel$scfamt[i] %in%
c(-9, -999) & ELSA_w6_cont_rel$DhR2[i] %in% c(96, -9, -999) & ELSA_w6_cont_rel$DhR3[i] %in%
c(96, -9, -999) & ELSA_w6_cont_rel$DhR4[i] %in% c(96, -9, -999) & ELSA_w6_cont_rel$DhR5[i] %in%
c(96, -9, -999) & ELSA_w6_cont_rel$DhR6[i] %in% c(96, -9, -999) & ELSA_w6_cont_rel$DhR7[i] %in%
c(96, -9, -999) & ELSA_w6_cont_rel$DhR8[i] %in% c(96, -9, -999) & ELSA_w6_cont_rel$DhR9[i] %in%
c(96, -9, -999) & ELSA_w6_cont_rel$DhR10[i] %in% c(96, -9, -999) & ELSA_w6_cont_rel$DhR11[i] %in%
c(96, -9, -999) & ELSA_w6_cont_rel$DhR12[i] %in% c(96, -9, -999) & ELSA_w6_cont_rel$DhR13[i] %in%
c(96, -9, -999) & ELSA_w6_cont_rel$DhR14[i] %in% c(96, -9, -999) & ELSA_w6_cont_rel$DhR15[i] %in%
c(96, -9, -999) & ELSA_w6_cont_rel$DhR16[i] %in% c(96, -9, -999)) {
ELSA_ds_w6$cont_rel[i] = 999
} else if (ELSA_w6_cont_rel$scchdg[i] %in% c(-1, -2) & ELSA_w6_cont_rel$scfamg[i] %in%
c(-1, -2) & ELSA_w6_cont_rel$scchdh[i] %in% c(-1, -2) & ELSA_w6_cont_rel$scchdi[i] %in%
c(-1, -2) & ELSA_w6_cont_rel$scchdt[i] %in% c(-1, -2) & ELSA_w6_cont_rel$scfamh[i] %in%
c(-1, -2) & ELSA_w6_cont_rel$scfami[i] %in% c(-1, -2) & ELSA_w6_cont_rel$scfamt[i] %in%
c(-1, -2) & ELSA_w6_cont_rel$DhR2[i] %in% c(-1, -2) & ELSA_w6_cont_rel$DhR3[i] %in%
c(-1, -2) & ELSA_w6_cont_rel$DhR4[i] %in% c(-1, -2) & ELSA_w6_cont_rel$DhR5[i] %in%
c(-1, -2) & ELSA_w6_cont_rel$DhR6[i] %in% c(-1, -2) & ELSA_w6_cont_rel$DhR7[i] %in%
c(-1, -2) & ELSA_w6_cont_rel$DhR8[i] %in% c(-1, -2) & ELSA_w6_cont_rel$DhR9[i] %in%
c(-1, -2) & ELSA_w6_cont_rel$DhR10[i] %in% c(-1, -2) & ELSA_w6_cont_rel$DhR11[i] %in%
c(-1, -2) & ELSA_w6_cont_rel$DhR12[i] %in% c(-1, -2) & ELSA_w6_cont_rel$DhR13[i] %in%
c(-1, -2) & ELSA_w6_cont_rel$DhR14[i] %in% c(-1, -2) & ELSA_w6_cont_rel$DhR15[i] %in%
c(-1, -2) & ELSA_w6_cont_rel$DhR16[i] %in% c(-1, -2)) {
ELSA_ds_w6$cont_rel[i] = 996
} else if (ELSA_w6_cont_rel$scchdg[i] == -8 & ELSA_w6_cont_rel$scfamg[i] ==
-8 & ELSA_w6_cont_rel$scchdh[i] == -8 & ELSA_w6_cont_rel$scchdi[i] ==
-8 & ELSA_w6_cont_rel$scchdt[i] == -8 & ELSA_w6_cont_rel$scfamh[i] ==
-8 & ELSA_w6_cont_rel$scfami[i] == -8 & ELSA_w6_cont_rel$scfamt[i] ==
-8 & ELSA_w6_cont_rel$DhR2[i] == -8 & ELSA_w6_cont_rel$DhR3[i] == -8 &
ELSA_w6_cont_rel$DhR4[i] == -8 & ELSA_w6_cont_rel$DhR5[i] == -8 & ELSA_w6_cont_rel$DhR6[i] ==
-8 & ELSA_w6_cont_rel$DhR7[i] == -8 & ELSA_w6_cont_rel$DhR8[i] == -8 &
ELSA_w6_cont_rel$DhR9[i] == -8 & ELSA_w6_cont_rel$DhR10[i] == -8 & ELSA_w6_cont_rel$DhR11[i] ==
-8 & ELSA_w6_cont_rel$DhR12[i] == -8 & ELSA_w6_cont_rel$DhR13[i] ==
-8 & ELSA_w6_cont_rel$DhR14[i] == -8 & ELSA_w6_cont_rel$DhR15[i] ==
-8 & ELSA_w6_cont_rel$DhR16[i] == -8) {
ELSA_ds_w6$cont_rel[i] = 998
} else if (ELSA_w6_cont_rel$scchdg[i] %in% c(4, 5, 6) & ELSA_w6_cont_rel$scfamg[i] %in%
c(4, 5, 6) & ELSA_w6_cont_rel$scchdh[i] %in% c(3, 4, 5, 6) & ELSA_w6_cont_rel$scchdi[i] %in%
c(3, 4, 5, 6) & ELSA_w6_cont_rel$scchdt[i] %in% c(3, 4, 5, 6) & ELSA_w6_cont_rel$scfamh[i] %in%
c(3, 4, 5, 6) & ELSA_w6_cont_rel$scfami[i] %in% c(3, 4, 5, 6) & ELSA_w6_cont_rel$scfamt[i] %in%
c(3, 4, 5, 6) & !(ELSA_w6_cont_rel$DhR2[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR3[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR4[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR5[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR6[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR7[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR8[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR9[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR10[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR11[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR12[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR13[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR14[i] %in% c(1:21) | ELSA_w6_cont_rel$DhR15[i] %in%
c(1:21) | ELSA_w6_cont_rel$DhR16[i] %in% c(1:21))) {
ELSA_ds_w6$cont_rel[i] = 0
}
}
ELSA_ds_w6$cont_rel <- car::recode(as.vector(ELSA_ds_w6$cont_rel), "NA='999'")
ELSA_ds_w6$cont_rel <- labelled(ELSA_ds_w6$cont_rel, labels = c(No = 0, Yes = 1,
Missing = 999, `Do not know` = 998, Refuse = 997, `Not applicable` = 996,
`Don't answer` = 995, `Not attempt/not done/not yet recorded` = 994, `Disable to measure` = 993,
Impute = 992, `CAPI/interviewer error` = 991))
|
|
|